package com.shell.arouter.demo.litho;

import com.durian.base.utils.UIUtils;
import com.facebook.litho.Column;
import com.facebook.litho.Component;
import com.facebook.litho.ComponentContext;
import com.facebook.litho.annotations.LayoutSpec;
import com.facebook.litho.annotations.OnCreateLayout;
import com.facebook.litho.widget.Text;
import com.facebook.yoga.YogaEdge;
import com.henanjianye.soon.communityo2o2.R;

/**
 * 说明：ListItemSpec
 * <p/>
 * 作者：fanly
 * <p/>
 * 类型：Class
 * <p/>
 * 时间：2020-01-19 11:20
 * <p/>
 * 版本：version 1.0
 */
@LayoutSpec
public class ListItemSpec {
    @OnCreateLayout
    static Component onCreateLayout(ComponentContext c){
        return Column.create(c)
                .paddingDip(YogaEdge.ALL, 16f)
                .backgroundColor(UIUtils.getColor(R.color.base_app_theme_color))
                .child(Text.create(c).text("Hello word").textSizeSp(40f))
                .child(Text.create(c).text("Litho tutorial").textSizeSp(20f))
                .build();
    }
}
